package com.btpj.hospital_server.service;

import com.btpj.hospital_server.entity.LogAccountLogin;
import com.btpj.hospital_server.mapper.LogAccountLoginMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 登录日志Service
 *
 * @author BTPJ  2020/8/28
 */
@Service
public class LogAccountLoginService {

    @Resource
    LogAccountLoginMapper logAccountLoginMapper;

    /**
     * 获取登录日志列表
     *
     * @param accountName 账号名称（模糊匹配）
     * @return 获取登录日志列表
     */
    public List<LogAccountLogin> getList(String accountName) {
        return logAccountLoginMapper.selectListByAccountName(accountName);
    }

    /**
     * 添加登录日志
     *
     * @param logAccountLogin LogAccountLogin
     */
    public void addLoginLog(LogAccountLogin logAccountLogin) {
        logAccountLoginMapper.insertSelective(logAccountLogin);
    }
}
